The patch attached restores NX/XD support in x86_64 xenlinux. When the
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 13 Jul 2005 08:37:38 +0000 (08:37 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 13 Jul 2005 08:37:38 +0000 (08:37 +0000)
port was being done, Xen did not want to see the bit 63 in ptes, and it
now allows the guests to set it. Also include cleanups (warning when
compiling domU).

Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c
linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c

index 07e0035617d7c9fa2bef6507b94d2b827c8e2a79..e5fd75f06bc56479bb9284e97f3805b1e4ace978 100644 (file)
@@ -194,16 +194,10 @@ void __init check_efer(void)
 {
        unsigned long efer;
 
-        /*     rdmsrl(MSR_EFER, efer);  */
-
-        /*
-         * At this point, Xen does not like the bit 63.
-         * So NX is not supported. Come back later.
-         */
-        efer = 0;
-
+       rdmsrl(MSR_EFER, efer); 
         if (!(efer & EFER_NX) || do_not_nx) { 
                 __supported_pte_mask &= ~_PAGE_NX; 
+
         }       
 }
 
index 0bb164a88cd5155b8b4372aefa6c90f4a74eee1b..b99641750b319b8ece6c86872bd247bee351230d 100644 (file)
@@ -641,8 +641,6 @@ void zap_low_mappings(void)
 #ifndef CONFIG_DISCONTIGMEM
 void __init paging_init(void)
 {
-        int i;
-
        {
                unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
                 /*     unsigned int max_dma; */
@@ -664,14 +662,17 @@ void __init paging_init(void)
         memset(empty_zero_page, 0, sizeof(empty_zero_page));
 
 #ifdef CONFIG_XEN_PHYSDEV_ACCESS
+       {
+               int i;
         /* Setup mapping of lower 1st MB */
-        for (i = 0; i < NR_FIX_ISAMAPS; i++)
-                if (xen_start_info.flags & SIF_PRIVILEGED)
-                        set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
-                else
-                        __set_fixmap(FIX_ISAMAP_BEGIN - i,
-                                    virt_to_machine(empty_zero_page),
-                                    PAGE_KERNEL_RO);
+               for (i = 0; i < NR_FIX_ISAMAPS; i++)
+                       if (xen_start_info.flags & SIF_PRIVILEGED)
+                               set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
+                       else
+                               __set_fixmap(FIX_ISAMAP_BEGIN - i,
+                                            virt_to_machine(empty_zero_page),
+                                            PAGE_KERNEL_RO);
+       }
 #endif
 
 }